﻿@using ForzaGT3.Areas.Admin.Models
@model NewsModel
@{
    ViewBag.Title = "Edit";
}
<div class="well">
    @using (Html.BeginForm(MVC.Admin.News.Edit(), FormMethod.Post, new { @class = "form-horizontal", @enctype = "multipart/form-data" }))
    {
        <fieldset>
            <div id="legend" class="">
                <legend class="">Edit News</legend>
                @Html.HiddenFor(m => m.Id)
            </div>
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Url</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Url, new { @placeholder = "Url", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.Url)</p>
                </div>
            </div>
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Title</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Title, new { @placeholder = "Title", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.Title)</p>
                </div>
            </div>
            <div class="control-group">
                <!-- Textarea -->
                <label class="control-label">
                    Intro</label>
                <div class="controls">
                    <div class="textarea">
                        @Html.TextAreaFor(m => m.Intro, new { @class = "tinymce", @maxlength = "250" })
                    </div>
                </div>
            </div>
            <div class="control-group">
                <!-- Textarea -->
                <label class="control-label">
                    Content</label>
                <div class="controls">
                    <div class="textarea">
                        @Html.TextAreaFor(m => m.Content, new { @class = "tinymce", @maxlength = "8000" })
                    </div>
                </div>
            </div>
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Keywords</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Keywords, new { @placeholder = "Keywords", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.Keywords)</p>
                </div>
            </div>
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Url English</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.UrlEnglish, new { @placeholder = "Url", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.UrlEnglish)</p>
                </div>
            </div>
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Title English</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.TitleEnglish, new { @placeholder = "Title", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.TitleEnglish)</p>
                </div>
            </div>
            <div class="control-group">
                <!-- Textarea -->
                <label class="control-label">
                    Intro English</label>
                <div class="controls">
                    <div class="textarea">
                        @Html.TextAreaFor(m => m.IntroEnglish, new { @class = "tinymce", @maxlength = "250" })
                    </div>
                </div>
            </div>
            <div class="control-group">
                <!-- Textarea -->
                <label class="control-label">
                    Content English</label>
                <div class="controls">
                    <div class="textarea">
                        @Html.TextAreaFor(m => m.ContentEnglish, new { @class = "tinymce", @maxlength = "8000" })
                    </div>
                </div>
            </div>
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Keywords English</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.KeywordsEnglish, new { @placeholder = "Keywords", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.KeywordsEnglish)</p>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    Image</label>
                <!-- File Upload -->
                <div class="controls">
                    <img src="@Url.Content("~" + Model.ImageUrl)" alt="@Model.Title" />
                    @Html.TextBoxFor(m => m.Image, new { @type = "file", @class = "input-file" })
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    Is Published</label>
                <!-- Multiple Checkboxes -->
                <div class="controls">
                    <label class="checkbox inline">
                        @Html.CheckBoxFor(m => m.IsPublished)
                    </label>
                </div>
            </div>
            <div class="control-group">
                <!-- Form Actions -->
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">
                        Save changes</button>
                    <button onclick="javascript:location.href='/Admin/News';" type="button" class="btn">
                        Cancel</button>
                </div>
            </div>
        </fieldset>
    }
</div>
<script type="text/javascript" src="@Links.Areas.Admin.Assets.tinymce.jscripts.tiny_mce.tiny_mce_js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode: "specific_textareas",
        editor_selector: "tinymce",
        theme: "advanced",
        plugins: "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,insertdate,inserttime,preview,|,fullscreen",
        theme_advanced_buttons2: "forecolor,backcolor,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,cleanup,help,code",
        //theme_advanced_buttons2: "forecolor,backcolor,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,cleanup,help,code",
        // theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl,|,restoredraft,styleprops",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,advhr,|,ltr,rtl,|,restoredraft,styleprops",
        theme_advanced_buttons4: "",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        theme_advanced_resizing: true,
        maxlength: 1000,
        // Skin options
        skin: "o2k7",
        skin_variant: "silver"
    });
</script>
